{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Nelson-Siegel-Svensson Models"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Nelson-Siegel and Nelson-Siegel-Svensson curves are models for interest rate curve in the financial markets. They provide a parametric formula specifying the interest rate as a function of a future time point."
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "**Nelson-Siegel Curve:**\n",
    "\n",
    "$$y(t) = \\beta_0 + \\beta_1 \\Bigg(\\frac{1-e^{\\frac{-t}{\\tau_1}}}{t / \\tau_1}\\Bigg) + \\beta_2 \\Bigg(\\frac{1-e^{\\frac{-t}{\\tau_1}}}{t / \\tau_1} - e^{\\frac{-t}{\\tau_1}}\\Bigg)$$"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "**Nelson-Siegel-Svensson Curve:**\n",
    "\n",
    "$$y(t) = \\beta_0 + \\beta_1 \\Bigg(\\frac{1-e^{\\frac{-t}{\\tau_1}}}{t / \\tau_1}\\Bigg) + \\beta_2 \\Bigg(\\frac{1-e^{\\frac{-t}{\\tau_1}}}{t / \\tau_1} - e^{\\frac{-t}{\\tau_1}}\\Bigg) + \\beta_3 \\Bigg(\\frac{1-e^{\\frac{-t}{\\tau_2}}}{t / \\tau_2} - e^{\\frac{-t}{\\tau_2}}\\Bigg)$$"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "The `nelson_siegel_svensson` Python package provides implementations of both these formulas. The classes `NelsonSiegelCurve` and `NelsonSiegelSvenssonCurve` are instantiated with the parameters and the instances can then be called like functions for a time point (or a `numpy` array of time points)."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [],
   "source": [
    "from nelson_siegel_svensson import NelsonSiegelSvenssonCurve\n",
    "import numpy as np\n",
    "from matplotlib import pyplot as plt"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "NelsonSiegelSvenssonCurve(beta0=0.028, beta1=-0.03, beta2=-0.04, beta3=-0.015, tau1=1.1, tau2=4.0)"
      ]
     },
     "execution_count": 4,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "y = NelsonSiegelSvenssonCurve(0.028, -0.03, -0.04, -0.015, 1.1, 4.0)\n",
    "y"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "-0.002175826394433338"
      ]
     },
     "execution_count": 10,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "y(1.5)  # calling the curve for a single time point"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([-0.00345177, -0.00046395,  0.00316059])"
      ]
     },
     "execution_count": 11,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# calling the curve for a numpy array of time points\n",
    "# this is more efficient than calling multiple individual time points \n",
    "y(np.array([1.0, 2.0, 3.0]))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYwAAAD8CAYAAABkbJM/AAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDMuMC4yLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvOIA7rQAAIABJREFUeJzt3Xl8VPW9//HXhwTCmkAIS0jCZthBFCLQlrrUiri0WGuVaqutttbb8mttq9bbxbZ669VutlqvvVatYlvF0lZpRVFEqyIgQdawhhAgAZKQkIUt6+f3xwzeGAMMZJLJZN7Px2MemTnne858OLO8Oed7znfM3RERETmZTpEuQEREooMCQ0REQqLAEBGRkCgwREQkJAoMEREJiQJDRERCosAQEZGQKDBERC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2rgmXA9X6hO8N0QkfdYrAXG8YYpabZN8MNVAfRtk+qA4CGws4EVzcz+iJmtNbOXzGxcG5XkwCtmtsrMbm5mfijbtDXN5vgf5EhsL2jZkDlt5Ub+7zT2pk72mreGkw0FFMnt9XGgyN23HWd+m2yvJt8NEXmPxVpgtGtm1hP4G3Cru1c2mf0egcMuE4GHgOfbqKzp7j4JuAT4hpmd20bPe1Jm1gX4NPDXZmZHant9gAeODbSrUxHN7AdAHfDn4zRp69f8EeAM4CxgL4HDP+3J5znx3kWrb68TfTe05Xss1gKjEMho9Pj94Uiaa2Nm8UASUNrahZlZZwJviD+7+9+bznf3Snc/GLy/EOhsZimtXZe7HxuupRj4B4FDA42Fsk1byyXAe95oKJljIrW9goqOHZazEw+Z0+bbzcy+BFwOXBf8ovmQEF7zsHL3Inevd/cG4A/Heb5Iba944Epg3vHatPb2Os53Q0TeY7EWGCuBEWY2LPi/09kEhjdprPFwJ1cBS473wQqX4DHSx4FN7v7r47QZeKwvxcymEHjtWjXIzKyHmfU6dp9Ap2nTYVoWANdbwDSgotGucms77v/8IrG9GjntIXNasygzmwncAXza3Q8fp00or3m46wplKKBQPrut4ZPAZncvaG5ma2+vE3w3ROY91ho9++35RuCsnq0Ezrj4QXDa3QQ+RABdCRziyAXeBYa3QU3TCexSrgPWBG+XArcQGGIFYA6QQ+DskOXAR9ugruHB51sbfO5j26txXQY8HNye64GsNnodexAIgKRG09p8exEIrL1ALYFjxDcR6PN6DdgGLAaSg22zgMcaLXtj8H2WC3y5DerKJXBM+9h77NjZgIOAhSd6zVu5rqeD7511BL4IU5vWFXz8oc9ua9YVnP7ksfdUo7Ztub2O990QkfeYrvQWEZGQxNohKREROU0KDBERCYkCQ0REQqLAEBGRkCgwREQkJAoMEREJiQJDRERCosAQEZGQ/H9z/yzhqMDKXwAAAABJRU5ErkJggg==\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "t = np.linspace(0, 20, 100)\n",
    "plt.plot(t, y(t), label='A Nelson-Siegel-Svensson curve');"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 19,
   "metadata": {},
   "outputs": [],
   "source": [
    "plt.plot?"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.7.2"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
